package com.bdqn.t369springbootwab.controller;


import com.bdqn.t369springbootwab.service.DemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController // 该类的所有方法都是Rest风格（直接响应数据）
public class HelloController {

    // 注入Service层
    @Resource
    private DemoService demoService;

    @GetMapping("/hello")
    public String hello(){
        String say = demoService.sayHello();
        return say;
    }
}
